﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Best.Framework.DALFactory;
using DQYT.HTDZ.IDAL;
using DQYT.HTDZ.Model;
using System.Data;

namespace DQYT.HTDZ.BLL
{
    public class BDRoleBLL
    {
        private readonly IBDRole dal = DataAccess.CreateBDRole();

        #region  Method

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int JSE_ID)
        {
            return dal.Exists(JSE_ID);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(BDRoleModel model)
        {
            return dal.Add(model);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(BDRoleModel model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int JSE_ID)
        {
            return dal.Delete(JSE_ID);
        }
        /// <summary>
        /// 批量删除数据
        /// </summary>
        public bool DeleteList(string JSE_IDlist)
        {
            return dal.DeleteList(JSE_IDlist);
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public BDRoleModel GetModel(int JSE_ID)
        {
            return dal.GetModel(JSE_ID);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }

        /// <summary>
        /// 获取记录总数
        /// </summary>
        public int GetRecordCount(string strWhere)
        {
            return dal.GetRecordCount(strWhere);
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
        {
            return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
        }

        #endregion  Method

        #region 新添加的
        /// <summary>
        /// 获得查询数据
        /// </summary>
        /// <param name="strWhere">查询条件，jiaose j left join userinfo u </param>
        /// <returns>SELECT j.jse_id,j.jse_name,j.jse_description,count(u.use_id) as iNum</returns>
        public DataTable GetData(string strWhere)
        {
            return dal.GetData(strWhere);
        }

        /// <summary>
        /// 获得下一个最大值
        /// </summary>
        /// <returns></returns>
        public int GetNextID()
        {
            return dal.GetNextID();
        }


        /// <summary>
        /// 获得记录数
        /// </summary>
        /// <param name="strWhere"></param>
        /// <returns></returns>
        public bool CheckMC(string strWhere)
        {
            return dal.CheckMC(strWhere);
        }
        #endregion
    }
}
